//
// Created by Administrator on 2024-1-26.
//

#include <iostream>
#include "Point.h"

void Point::set(int new_x, int new_y) {
    if(new_x < 0){
        new_x *= -1;
    }
    if(new_y < 0){
        new_y *= -1;
    }
    x = new_x;
    y = new_y;
}

int Point::get_x() {
    return x;
}

int Point::get_y() {
    return y;
}

int mainPoint(){
    Point pt1,pt2;

    pt1.set(10,20);
    std::cout << "p1  是 " << pt1.get_x();
    std::cout << ", " << pt1.get_y() << std::endl;

    pt2.set(-5,-25);
    std::cout << "p2  " << pt2.get_x();
    std::cout << ", " << pt2.get_y() << std::endl;

    /**
     * c++ 中文乱码
     * 1. setting file-encoding 全 “UTF-8”
     * 2. SHIFT shift: registry ,取消勾选  run.processes.with.pty
     */

    return 0;
}
